package com.education.wisdom.service.impl;

import com.education.common.utils.Convert;
import com.education.wisdom.mapper.HelpMapper;
import com.education.wisdom.pojo.Help;
import com.education.wisdom.service.IHelpService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * 求助 服务层实现
 *
 * @author ruoyi
 * @date 2019-01-24
 */
@Service
public class HelpServiceImpl implements IHelpService {

    @Autowired
    private HelpMapper helpMapper;

    /**
     * 查询求助信息
     *
     * @param id 求助ID
     * @return 求助信息
     */
    @Override
    public Help selectHelpById(Integer id) {
        return helpMapper.selectHelpById(id);
    }

    /**
     * 查询求助列表
     *
     * @param help 求助信息
     * @return 求助集合
     */
    @Override
    public List<Help> selectHelpList(Help help) {
        return helpMapper.selectHelpList(help);
    }

    /**
     * 新增求助
     *
     * @param help 求助信息
     * @return 结果
     */
    @Override
    public int insertHelp(Help help) {
        return helpMapper.insertHelp(help);
    }

    /**
     * 修改求助
     *
     * @param help 求助信息
     * @return 结果
     */
    @Override
    public int updateHelp(Help help) {
        return helpMapper.updateHelp(help);
    }

    /**
     * 删除求助对象
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteHelpByIds(String ids) {
        return helpMapper.deleteHelpByIds(Convert.toStrArray(ids));
    }

    @Override
    public List<Help> selectList() {
        return helpMapper.selectList();
    }

    @Override
    public List<Help> selectHelpByUserId(String userId) {
        return helpMapper.selectHelpByUserId(userId);
    }

    @Override
    public List<Help> selectListByTime() {
        return helpMapper.selectListByTime();
    }

    @Override
    public List<Help> selectByCurrency(Map<String, Object> map) {
        return helpMapper.selectByCurrency(map);
    }

    @Override
    public List<Help> selectListByBrowse(Map<String, Object> map) {
        return helpMapper.selectListByBrowse(map);
    }

    @Override
    public List<Help> selectAllList(Map<String, Object> map) {
        return helpMapper.selectAllList(map);
    }

    @Override
    public List<Help> selectListAll(Map<String, Object> map) {
        return helpMapper.selectListAll(map);
    }

    @Override
    public List<Help> selectByCurrencys(Map<String, Object> map) {
        return helpMapper.selectByCurrencys(map);
    }

    @Override
    public List<Help> selectListByBrowses(Map<String, Object> map) {
        return helpMapper.selectListByBrowses(map);
    }

    @Override
    public List<Help> selectByNotAdopted() {
        return helpMapper.selectByNotAdopted();
    }

    @Override
    public List<Help> selectByUserIdAndType(Map<String, Object> map) {
        return helpMapper.selectByUserIdAndType(map);
    }
}
